﻿<%@ Page Title="" Language="C#" Theme = "DetailsView" MasterPageFile="~/Students.master" AutoEventWireup="true" CodeFile="SLeave.aspx.cs" Inherits="SLeave" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:DetailsView 
         ID = "dtlLeave"
         DataSourceID = "srcLeave"
         SkinID = "Colorful"
         AutoGenerateRows = "false"
         DefaultMode = "Insert"
         AutoGenerateInsertButton = "true"
         HeaderText = "请假单"
         runat = "server" >
         <Fields>
         <asp:BoundField 
             DataField = "sid"
             HeaderText = "学号" />
         <asp:BoundField 
             DataField = "sname"
             HeaderText = "姓名" />
         <asp:BoundField 
             DataField = "b_n"
             HeaderText = "楼房" />
         <asp:BoundField 
             DataField = "d_n"
             HeaderText = "宿舍号" />
         <asp:BoundField 
             DataField = "reasons"
             HeaderText = "原因" /> 
         <asp:BoundField 
             DataField = "leavetime"
             HeaderText = "请假日期" />
         <asp:BoundField 
             DataField = "leavedays"
             HeaderText = "请假天数" />
                         
         </Fields>
    </asp:DetailsView>
    <asp:SqlDataSource 
         ID = "srcLeave"
         ConnectionString = "<%$ConnectionStrings:Dormitory %>"
         InsertCommand = "insert leaveapplication(sid,sname,b_n,d_n,reasons,leavetime,leavedays)
            values(@sid,@sname,@b_n,@d_n,@reasons,@leavetime,@leavedays)"
         runat = "server" ></asp:SqlDataSource>
</asp:Content>

